package com.qijia.common.domain;

import javax.persistence.Column;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.MappedSuperclass;

/**
 * AbstractCommonUserRole entity provides the base persistence definition of the
 * CommonUserRole entity. @author MyEclipse Persistence Tools
 */
@MappedSuperclass
public abstract class AbstractCommonUserRole  extends BaseData implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 8667635775538164665L;
	// Fields

	private Integer CUrId;
	private Users users;
	private Role role;

	// Constructors

	/** default constructor */
	public AbstractCommonUserRole() {
	}

	/** full constructor */
	public AbstractCommonUserRole(Users users, Role role) {
		this.users = users;
		this.role = role;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "c_ur_id", unique = true, nullable = false)
	public Integer getCUrId() {
		return this.CUrId;
	}

	public void setCUrId(Integer CUrId) {
		this.CUrId = CUrId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "c_ur_user_id")
	public Users getUsers() {
		return this.users;
	}

	public void setUsers(Users users) {
		this.users = users;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "c_ur_role_id" )
	public Role getRole() {
		return this.role;
	}

	public void setRole(Role role) {
		this.role = role;
	}

}